package com.lightbend.akka

import akka.actor.{Actor, ActorLogging}
import akka.dispatch.{BoundedMessageQueueSemantics, RequiresMessageQueue}

class MyBoundedActor extends Actor with RequiresMessageQueue[BoundedMessageQueueSemantics] with ActorLogging {

  override def receive: Receive = {
    case e:Int =>
      Thread.sleep(100)
      MyBoundedActor.addCount
      println(s"=====================> msgId: $e ,  处理个数：${MyBoundedActor.count}")
//      sender ! e
  }
}

object MyBoundedActor {
  var count = 0
  def addCount = count += 1
}
